import React from 'react'
import Flex from 'antd-mobile/lib/flex'
import WingBlank from 'antd-mobile/lib/wing-blank'

import 'antd-mobile/lib/flex/style/css'
import 'antd-mobile/lib/wing-blank/style/css'
import './Notify.scss'

type Props = {
  icon: string
  btn_text?: string
  onClick?: () => void
}

export default class Notify extends React.PureComponent<Props, {}> {
  render () {
    const { icon, btn_text:text, onClick } = this.props
    return (
      <div className="com_notify">
        <WingBlank size="lg">
          <Flex className="com_notify_container">
            <div className="notify_icon"
              style={{backgroundImage: icon}}
            ></div>
            <Flex.Item className="notify_text">欢迎关注哟！</Flex.Item>
            <a className="notify_btn"
              style={{backgroundImage: icon}}
              onClick={onClick}
            >{text}</a>
          </Flex>
        </WingBlank>
      </div>
    )
  }
}
